package summer_vacation.qiuyangyang;
import java.util.Scanner;
/**
 * Created by Administrator on 2015/8/21 0021.
 */
public class Assignment_02 {public static void main(String[] args) {
    int i=0;
    System.out.println("请输入一个数：");
    Scanner scan=new Scanner(System.in);
    String str1=scan.nextLine();
    int m=Integer.parseInt(str1);
    System.out.println("再输入一个数：");
    String str2=scan.nextLine();
    int n=Integer.parseInt(str2);
    for(i=m;i>1;i--){
        if(m%i==0&&n%i==0){
            System.out.println("最大公约数为"+i);
            break;
        }else{
            System.out.println("最大公约数为1");
        }
    }

}

}
